// import store from '../store/index';
import Vue from 'vue'
import VueRouter from 'vue-router'
import login from '../views/login/login.vue'
Vue.use(VueRouter)
import MenuManagement from '../views/System management_pzq/MenuManagement.vue'
import AboutMenu from '../views/System management_pzq/AboutMenu.vue'
import ViewportMenu from '../views/System management_pzq/ViewportMenu.vue'
import AboutType from '../views/System management_pzq/AboutType'
import TypeManagement from '../views/System management_pzq/TypeManagement'
import StateManagement from '../views/System management_pzq/StateManagement'
import AboutState from '../views/System management_pzq/AboutState'
import CourierCompany from '../views/System management_pzq/CourierCompany'
import AboutCourier from '../views/System management_pzq/AboutCourier'

const routes = [
  //公共页面路由
  {
    path: '/',
    redirect: '/login'
  },
  {
    path: '/login',
    name: 'longinPage',
    component: login
  },



  //  菜单路由
  {
    path: '/home',
    name: 'homePage',
    component: () => import('../views/home/home'),
    redirect: '/home/first',
    meta: {
      title: '首页'
    },
    children: [
      {
        path: '/home/first',
        name: 'firstPage',
        component: () => import('../views/home/first'),
        meta: {
          title: '控制面板'
        },
      },
      {
        path: '/home/role',
        name: 'rolePage',
        redirect: '/home/role/list',
        component: () => import('../views/role/role'),
        meta: {
          title: '角色管理'
        },
        children: [
          {
            path: '/home/role/list',
            name: 'roleListPage',
            component: () => import('../views/role/roleList'),
            meta: {
              title: '角色列表'
            },

          },
          {
            path: '/home/role/limits',
            name: 'limitsPage',
            component: () => import('../views/role/limits'),
            meta: {
              title: '权限设置'
            },
          },
        ]
      },
      {
        path: '/home/market',
        name: 'marketPage',
        redirect: '/home/market/activity',
        component: () => import('../views/market/marketing'),
        meta: {
          title: '营销管理'
        },
        children: [
          {
            path: '/home/market/activity',
            name: 'activityPage',
            component: () => import('../views/market/activity'),
            meta: {
              title: '营销活动'
            },
          },
          {
            path: '/home/market/addActivity',
            name: 'addActivityPage',
            component: () => import('../views/market/addActivity'),
            meta: {
              title: '营销活动'
            },
          },
          {
            path: '/home/market/group',
            name: 'groupPage',
            component: () => import('../views/market/group'),
            meta: {
              title: '群组管理'
            },
          },
          {
            path: '/home/market/addGroup',
            name: 'addGroupPage',
            component: () => import('../views/market/addGroup'),
            meta: {
              title: '群组管理'
            },
          },
          {
            path: '/home/market/member',
            name: 'memberPage',
            component: () => import('../views/market/member'),
            meta: {
              title: '群组成员'
            },
          },
          {
            path: '/home/market/addMember',
            name: 'addMemberPage',
            component: () => import('../views/market/addMember'),
            meta: {
              title: '群组成员'
            },
          },
          {
            path: '/home/market/mail',
            name: 'mailPage',
            component: () => import('../views/market/mail'),
            meta: {
              title: '邮件模板'
            },
          },
          {
            path: '/home/market/addMail',
            name: 'addMailPage',
            component: () => import('../views/market/addMail'),
            meta: {
              title: '邮件模板'
            },
          },
          {
            path: '/home/market/emailMark',
            name: 'emailMarkPage',
            component: () => import('../views/market/emailMark'),
            meta: {
              title: '邮件营销'
            },
          },
          {
            path: '/home/market/addEmailMark',
            name: 'addEmailMarkPage',
            component: () => import('../views/market/addEmailMark'),
            meta: {
              title: '邮件发送'
            },
          },
          {
            path: '/home/market/noteMode',
            name: 'noteModePage',
            component: () => import('../views/market/noteMode'),
            meta: {
              title: '短信模板'
            },
          },
          {
            path: '/home/market/addNote',
            name: 'addNotePage',
            component: () => import('../views/market/addNote'),
            meta: {
              title: '短信模板'
            },
          },
          {
            path: '/home/market/noteMarke',
            name: 'noteMarkePage',
            component: () => import('../views/market/noteMarke'),
            meta: {
              title: '短信营销'
            },
          },
          {
            path: '/home/market/addNoteMarke',
            name: 'addNoteMarkePage',
            component: () => import('../views/market/addNoteMarke'),
            meta: {
              title: '短信发送'
            },
          },
         



        ]
      },
       {
      // 诊断管理
      path: '/home/Diagnostic',
      name: 'Diagnostic',
      component: () => import('../views/Diagnostic_management_ssh/Diagnostic.vue'),
      meta: {
        title: '诊断管理'
      },
      children: [{
        path: '/home/Diagnostic/Diagnostic_mod',
        name: 'Diagnostic_mod',
        component: () => import('../views/Diagnostic_management_ssh/Diagnostic_mod.vue'),
        meta: {
          title: '诊断管理'
        },
      }, {
        path: '/home/Diagnostic/Diagnostic_add',
        name: 'Diagnostic_add',
        component: () => import('../views/Diagnostic_management_ssh/Diagnostic_add.vue'),
        meta: {
          title: '诊断管理'
        },
      }, {
        path: '/home/Diagnostic/Diagnostic_home',
        name: 'Diagnostic_home',
        component: () => import('../views/Diagnostic_management_ssh/Diagnostic_home.vue'),
        meta: {
          title: '诊断管理'
        },
      }]
    },
    {
      //诊断报表 
      path: '/home/report',
      name: 'report',
      redirect: "/home/report/report_home",
      component: () => import('../views/Diagnostic_management_ssh/report.vue'),
      meta: {
        title: '诊断报表'
      },
      children: [{
        path: '/home/report/report_home',
        name: 'report_home',
        component: () => import('../views/Diagnostic_management_ssh/report_home.vue'),
        meta: {
          title: '诊断报表'
        },
      }, {
        path: '/home/report/report_outpatient',
        name: 'report_outpatient',
        component: () => import('../views/Diagnostic_management_ssh/report_outpatient.vue'),
        meta: {
          title: '诊断报表'
        },
      },
      {
        path: '/home/report/report_hospital',
        name: 'report_hospital',
        component: () => import('../views/Diagnostic_management_ssh/report_hospital.vue'),
        meta: {
          title: '诊断报表'
        },
      }
      ]

    },
    {
      // 药品管理
      path: '/home/Drug_administration',
      name: 'Drug_administration',
      redirect: "/home/Drug_administration/Drug_home",
      component: () => import('../views/Drug_administration_ssh/Drug_administration.vue'),
      meta: {
        title: '药品管理'
      },
      children: [{
        path: '/home/Drug_administration/Drug_home',
        name: 'Drug_home',
        component: () => import('../views/Drug_administration_ssh/Drug_home.vue'),
        meta: {
          title: '药品管理'
        },
      }, {
        path: '/home/Drug_administration/Drug_add',
        name: 'Drug_add',
        component: () => import('../views/Drug_administration_ssh/Drug_add.vue'),
        meta: {
          title: '药品管理'
        },
      }, {
        path: '/home/Drug_administration/Drug_mod',
        name: 'Drug_mod',
        component: () => import('../views/Drug_administration_ssh/Drug_mod.vue'),
        meta: {
          title: '药品管理'
        },
      }]
    },
    {
      // 药品分类
      path: '/home/classification',
      name: 'classification',
      redirect: "/home/classification/classification_home",
      component: () => import('../views/Drug_administration_ssh/classification.vue'),
      meta: {
        title: '药品分类'
      },
      children: [{
        path: '/home/classification/classification_home',
        name: 'classification_home',
        component: () => import('../views/Drug_administration_ssh/classification_home.vue'),
        meta: {
          title: '药品分类'
        },
      },
      {
        path: '/home/classification/classification_add',
        name: 'classification_add',
        component: () => import('../views/Drug_administration_ssh/classification_add.vue'),
        meta: {
          title: '药品分类'
        },
      }, {
        path: '/home/classification/classification_addp',
        name: 'classification_addp',
        component: () => import('../views/Drug_administration_ssh/classification_addp.vue'),
        meta: {
          title: '药品分类'
        },
      }, {
        path: '/home/classification/classification_mod',
        name: 'classification_mod',
        component: () => import('../views/Drug_administration_ssh/classification_mod.vue'),
        meta: {
          title: '药品分类'
        },
      }]

    },
    {
      //药品库存
      path: '/home/Drug_inventory',
      name: 'Drug_inventory',
      redirect: "/home/classification/inventory_home",
      component: () => import('../views/Drug_administration_ssh/Drug_inventory.vue'),
      meta: {
        title: '药品库存'
      },
      children: [{
        path: '/home/classification/inventory_home',
        name: 'inventory_home',
        component: () => import('../views/Drug_administration_ssh/inventory_home.vue'),
        meta: {
          title: '药品库存'
        },
      }]
    }, 
    {
      // 日程管理
      path: '/home/Schedule_management',
      name: 'Schedule_management',
      redirect: "/home/Schedule_management/Schedule_home",
      component: () => import('../views/Schedule_management_ssh/Schedule_management.vue'),
      meta: {
        title: '日程管理'
      },
      children: [{
        path: '/home/Schedule_management/Schedule_home',
        name: 'Schedule_home',
        component: () => import('../views/Schedule_management_ssh/Schedule_home.vue'),
        meta: {
          title: '日程管理'
        },
      },
      {
        path: '/home/Schedule_management/Schedule_add',
        name: 'Schedule_add',
        component: () => import('../views/Schedule_management_ssh/Schedule_add.vue'),
        meta: {
          title: '日程管理'
        },
      }, {
        path: '/home/Schedule_management/Schedule_mod',
        name: 'Schedule_mod',
        component: () => import('../views/Schedule_management_ssh/Schedule_mod.vue'),
        meta: {
          title: '日程管理'
        },
      }]
    }, 
    {
      //我的日历
      path: '/home/calendar',
      name: 'calendar',
      redirect: "/home/calendar/calendar_home",
      component: () => import('../views/Schedule_management_ssh/calendar.vue'),
      meta: {
        title: '我的日历'
      },
      children: [{
        path: '/home/calendar/calendar_home',
        name: 'calendar_home',
        component: () => import('../views/Schedule_management_ssh/calendar_home.vue'),
        meta: {
          title: '我的日历'
        },

      }, {
        path: '/home/calendar/calendar_add',
        name: 'calendar_add',
        component: () => import('../views/Schedule_management_ssh/calendar_add.vue'),
        meta: {
          title: '我的日历'
        }
      }]
    },
    {
                // 患者管理
                path: '/home/patientsManagement',
                name: 'patientsManagement',
                component: () =>
                    import ("../views/PatientsManagement/PatientsManagementView"),
                meta: {
                    title: '患者管理'
                },
                redirect: '/home/patientsManagement/patientsManagementHome',
                children: [{
                    // 患者管理---主页面
                    path: '/home/patientsManagement/patientsManagementHome',
                    name: 'patientsManagementHome',
                    component: () =>
                        import ("../components/patientsManagementHome"),
                    meta: {
                        title: '患者管理'
                    },
                }, {
                    // 患者管理---新增
                    path: '/home/patientsManagement/patientsManagementAdd',
                    name: 'patientsManagementAdd',
                    component: () =>
                        import ("../components/patientsManagementAdd"),
                    meta: {
                        title: '患者管理'
                    },
                }, {
                    // 患者管理---修改
                    path: '/home/patientsManagement/patientsManagementModify',
                    name: 'patientsManagementModify',
                    component: () =>
                        import ("../components/patientsManagementModify"),
                    meta: {
                        title: '患者管理'
                    },
                }]
            
    },
     {
                // 患者跟进
                path: '/home/patientsFollow',
                name: 'patientsFollow',
                redirect: '/home/patientsFollow/patientsFollowHome',
                component: () =>
                    import ("../views/PatientsManagement/PatientsFollowView"),
                meta: {
                    title: '患者跟进'
                },
                children: [{
                        // 患者跟进---主页面
                        path: '/home/patientsFollow/patientsFollowHome',
                        name: 'patientsFollowHome',
                        component: () =>
                            import ("../components/patientsFollowHome"),
                        meta: {
                            title: '患者跟进'
                        },
                    },
                    {
                        // 患者跟进---新增
                        path: '/home/patientsFollow/patientsFollowAdd',
                        name: 'patientsFollowAdd',
                        component: () =>
                            import ("../components/patientsFollowAdd"),
                        meta: {
                            title: '患者跟进'
                        },
                    },
                    {
                        // 患者跟进---修改
                        path: '/home/patientsFollow/patientsFollowModify',
                        name: 'patientsFollowModify',
                        component: () =>
                            import ("../components/patientsFollowModify"),
                        meta: {
                            title: '患者跟进'
                        },
                    }
                ]
            },
            {
                // 患者公海
                path: '/home/patientsHighSeas',
                name: 'patientsHighSeas',
                redirect: '/home/patientsHighSeas/patientsHighSeasHome',
                component: () =>
                    import ("../views/PatientsManagement/PatientsHighSeasView"),
                meta: {
                    title: '患者公海'
                },
                children: [{
                    // 患者公海---主页面
                    path: '/home/patientsHighSeas/patientsHighSeasHome',
                    name: 'patientsHighSeasHome',
                    component: () =>
                        import ("../components/patientsHighSeasHome"),
                    meta: {
                        title: '患者公海'
                    },
                }]
            },
            {
                // 患者报表
                path: '/home/patientsReport',
                name: 'patientsReport',
                redirect: '/home/patientsReport/patientsReportHome',
                component: () =>
                    import ("../views/PatientsManagement/PatientsReportView"),
                meta: {
                    title: '患者报表'
                },
                children: [{
                    // 患者报表---主页面
                    path: '/home/patientsReport/patientsReportHome',
                    name: 'patientsReportHome',
                    component: () =>
                        import ("../components/patientsReportHome"),
                    meta: {
                        title: '患者报表'
                    },
                }]
            },
            {
                // 账号管理
                path: '/home/accountManagement',
                name: "accountManagement",
                redirect: '/home/accountManagement/accountManagementHome',
                component: () =>
                    import ("../views/EmailManagement/AccountManagementView"),
                meta: {
                    title: '账号管理'
                },
                children: [{
                        // 账号管理---主页面
                        path: '/home/accountManagement/accountManagementHome',
                        name: 'accountManagementHome',
                        component: () =>
                            import ("../components/accountManagementHome"),
                        meta: {
                            title: '账号管理'
                        },
                    },
                    {
                        // 账号管理---新增
                        path: '/home/accountManagement/accountManagementAdd',
                        name: 'accountManagementAdd',
                        component: () =>
                            import ("../components/accountManagementAdd"),
                        meta: {
                            title: '账号管理'
                        },
                    },
                    {
                        // 账号管理---修改
                        path: '/home/accountManagement/accountManagementModify',
                        name: 'accountManagementModify',
                        component: () =>
                            import ("../components/accountManagementModify"),
                        meta: {
                            title: '账号管理'
                        },
                    }
                ]
            },
            {
                // 邮件管理
                path: '/home/emailManagement',
                name: "emailManagement",
                redirect: '/home/emailManagement/emailManagementHome',
                component: () =>
                    import ("../views/EmailManagement/EmailManagementView"),
                meta: {
                    title: '邮件管理'
                },
                children: [{
                    // 邮件管理---主页面
                    path: '/home/emailManagement/emailManagementHome',
                    name: 'emailManagementHome',
                    redirect: '/home/emailManagement/emailManagementHome/Inbox',
                    component: () =>
                        import ("../components/emailManagementHome"),
                    meta: {
                        title: '邮件管理'
                    },
                    children: [{
                        // 收件箱
                        path: '/home/emailManagement/emailManagementHome/Inbox',
                        name: 'Inbox',
                        component: () =>
                            import ("../components/Inbox"),
                        meta: {
                            title: '邮件管理'
                        },
                    }, {
                        // 发件箱
                        path: '/home/emailManagement/emailManagementHome/Outbox',
                        name: 'Outbox',
                        component: () =>
                            import ("../components/Outbox"),
                        meta: {
                            title: '邮件管理'
                        },
                    }, {
                        // 草稿箱
                        path: '/home/emailManagement/emailManagementHome/drafts',
                        name: 'drafts',
                        component: () =>
                            import ("../components/drafts"),
                        meta: {
                            title: '邮件管理'
                        },
                    }, {
                        // 垃圾箱
                        path: '/home/emailManagement/emailManagementHome/dustbin',
                        name: 'dustbin',
                        component: () =>
                            import ("../components/dustbin"),
                        meta: {
                            title: '邮件管理'
                        },
                    }, {
                        // 回收站
                        path: '/home/emailManagement/emailManagementHome/recycleBin',
                        name: 'recycleBin',
                        component: () =>
                            import ("../components/recycleBin"),
                        meta: {
                            title: '邮件管理'
                        },
                    }, {
                        // 写信
                        path: '/home/emailManagement/emailManagementHome/writing',
                        name: 'writing',
                        component: () =>
                            import ("../components/writing"),
                        meta: {
                            title: '邮件管理'
                        },
                    }, {
                        // 查看
                        path: '/home/emailManagement/emailManagementHome/emailChaKan',
                        name: 'emailChaKan',
                        component: () =>
                            import ("../components/emailChaKan"),
                        meta: {
                            title: '邮件管理'
                        },
                    }]
                }]
            }, 
            {
                // 通讯录
                path: '/home/addressBook',
                name: "addressBook",
                redirect: '/home/addressBook/addressBookHome',
                component: () =>
                    import ("../views/AddressBook/AddressBookView"),
                meta: {
                    title: '通讯录'
                },
                children: [{
                    // 通讯录--主界面
                    path: '/home/addressBook/addressBookHome',
                    name: "addressBookHome",
                    redirect: '/home/addressBook/addressBookHome/recent',
                    component: () =>
                        import ("../components/addressBookHome"),
                    meta: {
                        title: '通讯录'
                    },
                    children: [{
                        // 通讯录--最近的页面
                        path: '/home/addressBook/addressBookHome/recent',
                        name: "recent",
                        component: () =>
                            import ("../components/recent"),
                        meta: {
                            title: '通讯录'
                        },
                    }, {
                        // 通讯录--点击新建联系人出现的页面
                        path: '/home/addressBook/addressBookHome/contacts',
                        name: "contacts",
                        component: () =>
                            import ("../components/contacts"),
                        meta: {
                            title: '通讯录'
                        },
                    }, {
                        // 通讯录--修改
                        path: '/home/addressBook/addressBookHome/addressBookModify',
                        name: "addressBookModify",
                        component: () =>
                            import ("../components/addressBookModify"),
                        meta: {
                            title: '通讯录'
                        },
                    }, {
                        // 通讯录--查看
                        path: '/home/addressBook/addressBookHome/addressBookChaKan',
                        name: "addressBookChaKan",
                        component: () =>
                            import ("../components/addressBookChaKan"),
                        meta: {
                            title: '通讯录'
                        },
                    }]
                }]
            },
           {
        path: '/home/userViews',
        name: 'userViewsPage',
        component: () => import('../views/userControl/userViews'),
        meta: {
          title: '用户管理'
        },
        children: [
          {
            path: '/home/userViews/department',
            name: 'departmentPage',
            component: () => import('../views/userControl/department'),
            meta: {
              title: '部门管理'
            }
          },
          {
            path: '/home/userViews/onlineUsers',
            name: 'onlineUsersPage',
            component: () => import('../views/userControl/onlineUsers'),
            meta: {
              title: '在线用户'
            }
          },
          {
            path: '/home/userViews/position',
            name: 'positionPage',
            component: () => import('../views/userControl/position'),
            meta: {
              title: '职位管理'
            }
          },
          {
            path: '/home/userViews/userControl',
            name: 'userControlPage',
            component: () => import('../views/userControl/userControl'),
            meta: {
              title: '用户管理'
            }
          },
          {
            path: '/home/userViews/userControlXinzeng',
            name: 'userControlXinzengPage',
            component: () => import('../views/userControl/userControlXinzeng'),
            meta: {
              title: '用户管理'
            }
          },
          {
            path: '/home/userViews/departmentXinzeng',
            name: 'departmentXinzengPage',
            component: () => import('../views/userControl/departmentXinzeng'),
            meta: {
              title: '部门管理'
            },
          },
          {
            path: '/home/userViews/positionXinzeng',
            name: 'positionXinzengPage',
            component: () => import('../views/userControl/positionXinzeng'),
            meta: {
              title: '职位管理'
            }
          },
        ]
       },
       {
    path: '/supplier',
    name: 'Supplier',
    component: () => import('../views/Suppliers/Supplier.vue'),
     meta: {
              title: '供应商管理'
            }
  },
  {
    path: '/addSuppliers',
    name: 'addSuppliers',
    component: () => import('../components/Supplierss/addSuppliers.vue'),
meta: {
              title: '供应商管理'
            }
  },
  {
    path: '/reviseSuppliers',
    name: 'reviseSuppliers',
    component: () => import('../components/Supplierss/reviseSuppliers.vue'),
    meta: {
              title: '供应商管理'
            }
  },
  {
    path: '/trail',
    name: 'trail',
    component: () => import('../views/Suppliers/trail.vue'),
    meta: {
              title: '供应商跟进'
            }

  },
  {
    path: '/addtrails',
    name: 'addtrails',
    component: () => import('../components/Supplierss/addtrails.vue'),
meta: {
              title: '供应商跟进'
            }
  },
  {
    path: '/spacecp',
    name: 'spacecp',
    component: () => import('../views/Suppliers/spacecp.vue'),
    meta: {
              title: '个人设置'
            }

  },
  {
    path: '/airlines',
    name: 'Airlines',
    component: () => import('../views/Suppliers/Airlines.vue'),
    meta: {
              title: '客服管理'
            }
  },
  {
    path: '/addAirlines',
    name: 'addAirlines',
    component: () => import('../components/Supplierss/addAirlines.vue'),
    meta: {
              title: '客服管理'
            }
  },
  {
    path: '/emerson',
    name: 'Emerson',
    component: () => import('../views/Suppliers/Emerson.vue'),
    meta: {
              title: '问题管理'
            }
  },
  {
    path: '/addEmerson',
    name: 'addEmerson',
    component: () => import('../components/Supplierss/addEmerson.vue'),
    meta: {
              title: '问题管理'
            }
  },
  {
    path: '/report',
    name: 'Report',
    component: () => import('../views/Suppliers/Report.vue'),
    meta: {
              title: '客服报表'
            }
  },

   {
        path: '/home/ViewportMenu',
        name: 'ViewportMenu',
        component: ViewportMenu,
        meta: {
          title: '系统管理'
        },
        children: [
          {
            path: '/home/ViewportMenu/MenuManagement',
            name: 'Menumanagement',
            component: MenuManagement,
            meta: {
              title: '菜单管理'
            }
          },
          {
            path: '/home/ViewportMenu/AboutMenu',
            name: 'AboutMenu',
            component: AboutMenu,
            meta: {
              title: '菜单管理'
            }
          },

          // {
          //   path: '/home/ViewportMenu/ViewportMenu',
          //   name: 'ViewportMenu',
          //   component: ViewportMenu,
          //   meta: {
          //     title: '菜单管理'
          //   }
          // },
          {
            path: '/home/ViewportType/AboutType',
            name: 'AboutType',
            component: AboutType,
            meta: {
              title: '类型管理'
            }
          },
          {
            path: '/home/ViewportType/TypeManagement',
            name: 'TypeManagement',
            component: TypeManagement,
            meta: {
              title: '类型管理'
            }
          },
          {
            path: '/home/ViewportState/StateManagement',
            name: 'StateManagement',
            component: StateManagement,
            meta: {
              title: '状态管理'
            }
          },
          {
            path: '/home/ViewportState/AboutState',
            name: 'AboutState',
            component: AboutState,
            meta: {
              title: '状态管理'
            }
          },
          {
            path: '/home/ViewportCourier/CourierCompany',
            name: 'CourierCompany',
            component: CourierCompany,
            meta: {
              title: '快递公司'
            }
          },
          {
            path: '/home/ViewportCourier/AboutCourier',
            name: 'AboutCourier',
            component: AboutCourier,
            meta: {
              title: '快递公司'
            }
          }
        ]
      }

    ]
  }
]

const createRouter = () => new VueRouter({
  mode: 'history',
  // base: process.env.BASE_URL,
  scrollBehavior: () => ({ y: 0 }),
  routes
})
const router = createRouter()
export function resetRouter() {
  const newRouter = createRouter()
  router.matcher = newRouter.matcher
}


export default router
